package org.model

import java.util.Date;

class SugarCase {
static searchable = {
  content: spellCheck 'include'
}

	static auditable = true
	String guid
	String sugarCaseNumber
	String name
	Date lastUpdated
	Date dateCreated
	String sugarDateCreated
	String sugarDateMod
	String description
	Type type
	String sugarStatus
	String sugarAssignedTo
	String accountGuid
	String accountName
	Double devTime
	
	boolean ignoreUpdate
	
	static hasOne  = [projectStatus:ProjectStatus, fixStatus:FixStatus]
	static hasMany = [updateElements:UpdateElements, tags:Tag, costs:Cost, fixes:ProjectFix]
	
	static constraints = {
		
		description nullable:true, maxSize:15000
		sugarStatus nullable: true
		guid nullable:true
		sugarCaseNumber nullable:true, unique: true
		name nullable:true, maxSize:1000
		sugarDateCreated nullable:true
		type nullable:true
		sugarAssignedTo nullable:true
		accountGuid nullable:true
		accountName nullable:true, maxSize:155
		devTime nullable:true, range:0..500
		projectStatus nullable:true
		fixStatus nullable:true
		sugarDateMod nullable:true
		
    }
	
	String toString() {return sugarCaseNumber}
}
